<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	</head>
	<body>
	</body>
	<script>
		$(document).ready(function() {
		    $.ajax({
		        url: 'student.xml',
		        type: 'GET',
		        dataType: 'xml',
		        timeout: 1000,  //设定超时
		        cache: false,   //禁用缓存
		        error: function(xml) {
		            alert("加载XML文档出错!");
		        },
		        success: function(xml){		//设置成功后回调函数
		        	$(xml).find("student").each(function(i) {     //查找所有student节点并遍历  
				        var id = $(this).children("id");          //获得子节点  
				        var id_vaule = id.text();                 //获取节点文本  
				        var email_vaule = $(this).attr("email");  //获取节点的属性  
				        console.log(id_vaule);
				        console.log(email_vaule);
				    });  
		        }
		    });
		});
		

	</script>
</html>
